package cn.silver.module.configuration.param;

import cn.silver.framework.core.utils.DateUtils;
import cn.silver.framework.mybatis.annotation.TableField;
import cn.silver.framework.mybatis.enums.SearchEnums;
import cn.silver.framework.mybatis.param.BusParam;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author zhouxiaobo
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Schema(name = "SerialParam", title = "序列号配置信息-查询对象")
public class SerialParam extends BusParam implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * 业务编码
     */
    @Schema(title = "业务编码")
    @TableField(name = "bus_code", searchType = SearchEnums.EQ)
    private String busCode;
    /**
     * 最新生成时间
     */
    @Schema(title = "最新生成时间")
    @TableField(name = "last_time", searchType = SearchEnums.BETWEEN)
    @JsonFormat(timezone = DateUtils.TIME_ZONE, pattern = DateUtils.YYYY_MM_DD)
    private LocalDateTime[] lastTime;
    /**
     * 启用/禁用
     */
    @Schema(title = "启用/禁用")
    @TableField(name = "enable", searchType = SearchEnums.EQ)
    private Boolean enable;
}
